package com.jy.modules.cims.component.sysAssist.BQRunner;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class TaskBQNodeCfgDB extends TaskBQNodeCfg {
	private String body ;
	private String runner;
	
	public String getRunner() {
		return runner;
	}
	public void setRunner(String runner) {
		this.runner = runner;
	}
	public String getBody() {
		return body;
	}
	public void setBody(String body) {
		this.body = body;
	}
	
	@Override
	public TaskBQNodeRunner getTaskBQNodeRunner() throws Exception {
		return (TaskBQNodeRunner)Class.forName(this.runner).newInstance();
	}
	
	@Override
	public void setNodeRunner(TaskBQNodeRunner nodeRunner) {
		this.runner = nodeRunner.getClass().getName().toString();
	}
	
	@Override
	public Object getNodeBody() {
		return JSON.parse(this.body);
	}
	
	@Override
	public void setNodeBody(Object nodeBody) {
		this.body = JSON.toJSONString(nodeBody, SerializerFeature.WriteClassName);
	}
		
}
